﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Merchant-List.aspx.cs" Inherits="Merchant_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <%--<link href="css/style-metro.css" rel="stylesheet" type="text/css" />--%>
    <link rel="stylesheet" type="text/css" href="css/select2_metro.css" />
    <link rel="stylesheet" href="css/DT_bootstrap.css" />
    <style type="text/css">
        .chart, .pie, .bars
        {
            height: 200px !important;
        }
        .portlet.box.yellow
        {
            border-style: none !important;
        }
        .form-horizontal .control-label
        {
            text-align: left !important;
            padding-top: 0px !important;
        }
        #address Label{font-size:13px;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:UpdatePanel runat="server" ID="up1">
        <ContentTemplate>
            <asp:UpdateProgress runat="server" ID="asas" AssociatedUpdatePanelID="up1">
                <ProgressTemplate>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <div class="row-fluid ">
                <div class="span12">
                    <!-- BEGIN TAB PORTLET-->
                    <div class="portlet box yellow tabbable">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-reorder"></i>Merchant</div>
                        </div>
                        <div class="portlet-body">
                            <div class="tabbable portlet-tabs">
                                <ul class="nav nav-tabs ulTab">
                                    <%--<li class="active "><a href="#portlet_tab2" class="liMerchantList" data-toggle="tab">MerchantList</a></li>--%>
                                    <li class="liMerchantInfo"><a href="#portlet_tab0" data-toggle="tab"><span class="merchantHeading">
                                        Merchant List</span> </a></li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane active panel0" id="portlet_tab0">
                                        <div class="portlet box " style="background-color: #eee;">
                                            <div class="portlet-title">
                                                <div class="caption" style="color: Black!important;">
                                                    <i class="icon-globe"></i>Merchant List</div>
                                            </div>
                                            <div class="portlet-body">
                                                <table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
                                                    <thead>
                                                        <tr>
                                                            <th>
                                                                Name
                                                            </th>
                                                            <th>
                                                                Business Name
                                                            </th>
                                                            <th>
                                                                Email
                                                            <th>
                                                                Mobile No
                                                            </th>
                                                            <th class="hidden-480">
                                                                Action
                                                            </th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <asp:Repeater ID="rptMerchant" runat="server">
                                                            <ItemTemplate>
                                                                <tr>
                                                                    <td>
                                                                        <%# Eval("Name")%>
                                                                    </td>
                                                                    <td>
                                                                        <%# Eval("BusinessName")%>
                                                                    </td>
                                                                    <td>
                                                                        <%# Eval("Email")%>
                                                                    </td>
                                                                    <td>
                                                                        <%# Eval("Mobile")%>
                                                                    </td>
                                                                    <td>
                                                                        <center>
                                                                            <%-- <asp:HiddenField runat="server" ID="hdf" Value='<%# Eval("Id") %>' />
                                                                            <asp:LinkButton runat="server" ID="btnView" Text="View" CommandArgument='<%# Eval("ID") %>'
                                                                                OnClientClick="BindInfo(this)" OnClick="OnView"></asp:LinkButton>--%>
                                                                            <a href="#" onclick="BindInfo('<%# Eval("Id")  %>')">view</a>
                                                                        </center>
                                                                    </td>
                                                                </tr>
                                                            </ItemTemplate>
                                                        </asp:Repeater>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- END TAB PORTLET-->
                    </div>
                </div>
            </div>
            <asp:TextBox runat="server" ID="hdfCount" Style="display: none;" class="hiddenValue1"
                Text="1"></asp:TextBox>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="divGraph">
        <!-- build graph with jQuery. -->
    </div>
    <div id="tabs" style="display: none;">
        <a style='padding-right: 0px !important' href='#portlet_tab" + d + "' data-toggle='tab'>
            <span class='merchantHeading' style='padding-right: 5px;'></span></a><a href='#'
                style='cursor: pointer;' onclick='closeme();'>
                <img src='img/remove-icon-small.png' alt="" style='margin-left: 115px; margin-top: -108px;' /></a>
    </div>
    <div id="description" style="display: none; font-family: Verdana;">
        <div class='span6 pd10'>
            <div class="">
                <h3 class="login_inner_heading">
                    Merchant Information</h3>
                <h4 class="grey txt_upper">
                    <label style='font-size: 13px; text-transform: uppercase;' class='businessName'>
                    </label>
                </h4>
                <div id="address">
                <h4 class="grey">
                    <label class='address1'>
                        Address1</label>
                    <label class='address2'>
                        ddress2</label>
                    <label class='city'>
                        ahmedabad</label>
                    <label class='pincode'>
                        380013</label>
                    <label>
                        India:</label>
                    <label class='mobileNo'>
                        7878424245:</label>
                </h4>
                </div>
                <div class="divider">
                </div>
                <div>
                    <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Account Type :</h5>
                            <div class="controls">
                                <asp:Label ID="lblSubscription" runat="server" Text="Economy" CssClass="grey"></asp:Label>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Account Created Date:</h5>
                            <div class="controls">
                                <asp:Label ID="lblAccCreatedDate" runat="server" Text="18-06-2014" CssClass="grey"></asp:Label>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Account Expiry Date:</h5>
                            <div class="controls">
                                <asp:Label ID="lblStartDate" runat="server" Text="28-06-2014" CssClass="grey"></asp:Label>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Number of Live Products:</h5>
                            <div class="controls">
                                <asp:Label ID="lblOldExpiryDate" runat="server" Text="127" CssClass="grey endDate"></asp:Label>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Last Logged in Date:</h5>
                            <div class="controls">
                                <asp:Label ID="Label1" runat="server" Text="24-06-2014 13:53" CssClass="grey endDate"></asp:Label>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix">
                    </div>
                    <br /><br />
                     <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Username:</h5>
                            <div class="controls">
                                <asp:Label ID="Label2" runat="server" Text="chandnijain191@gmail.com" CssClass="grey endDate"></asp:Label>
                            </div>
                        </div>
                    </div>
                     <div class="row-fluid">
                        <div class="control-group">
                            <h5 class="black control-label">
                                Password:</h5>
                            <div class="controls">
                                <asp:LinkButton ID="lnkreset" runat="server" Text="Reset" CssClass="green"></asp:LinkButton>
                            </div>
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    <script src="js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/select2.min.js"></script>
    <script type="text/javascript" src="js/jquery.dataTables.js"></script>
    <script type="text/javascript" src="js/DT_bootstrap.js"></script>
    <script src="js/table-advanced.js"></script>
    <%--chart js--%>
    <script>
        function BindInfo(Id) {

            d = Id;
            alert(d);
            var li = '.liMerchantInfo' + d;
            var panel = '.panel' + d;
            var tab = "#portlet_tab" + d;
            // alert('jay jalaram');
            if ($(panel).length <= 0) {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "./Merchant-List.aspx/LoadInfo",
                    data: "{Id:'" + Id + "'}",
                    dataType: "json",
                    success: function (Result) {
                        //e = parseInt($('.hiddenValue1').val());
                        //  alert('jay jalaram');

                        //    alert(d);
                        $('.hiddenValue1').val(d.toString());
                        $('.innerDiv').append("inner data1</br>");
                        $('.outerDiv').append("outer data1</br>");
                        $('.innerDiv').append("inner data1 &nbsp; ");
                        $('.outerDiv').append("outer data1 &nbsp;");
                        //Commented.
                        //$('.ulTab').append("<li class='liMerchantInfo" + d + "'><a style='padding-right:0px !important' href='#portlet_tab" + d + "'data-toggle='tab'><span class='merchantHeading' style='padding-right:5px;'>" + Result.d[0] + "</span> </a><a href='#' style='cursor:pointer;' onclick='closeme(" + d + ");'><img src='img/remove-icon-small.png' style='margin-left:115px;margin-top:-108px;' /></a></li>");

                        $("#tabs").find('.merchantHeading').html(Result.d[0]);
                        //var  = $("#tabs").html();
                        var tabHTML = $('#tabs').html().replace("closeme()", "closeme(" + d + ")");

                        //$(li).text(oneDiv);
                        $('.ulTab').append("<li class='liMerchantInfo" + d + "'>" + tabHTML + "</li>");

                        //alert($('.ulTab').html);
                        //chart_2();


                        //$('.tab-content').append("<div class='tab-pane active panel" + d + "' id='portlet_tab" + d + "'>jay jalaram" + d + ",jay matadi" + d + "</div>");
                        var portlateTab = '#portlet_tab' + d;
                        var portlateContent = $("#description").html();
                        $('.tab-content').append("<div class='tab-pane active panel" + d + "' id='portlet_tab" + d + "'>" + portlateContent + "</div>")
                        // $('.tab-content').append("<div style='padding-left: 25px; margin-top: 25px;'>")
                        //  $('.tab-content').append("<div class='row-fluid row'><div class='control-group'><label class='control-label' style='font-weight: bold;'>Account Type :</label><div class='controls'><label   class='lblpadding8 span3 planName'>Platinum<label><a href='#'>(Upgrade)</a></div></div>")




                        $('.active').removeClass("active");


                        $(li).addClass("active");
                        $(panel).addClass("active");

                        $(tab + ' .businessName').html(Result.d[0] + ' (' + Result.d[12] + ')');
                        // $('.businessName').html( + ' (' + Result.d[12] + ')');
                        $(tab + ' .lastLoginDate').html(Result.d[1]);
                        $(tab + ' .emailId').html(Result.d[2]);
                        $(tab + ' .address1').html(Result.d[3]);
                        $(tab + ' .address2').html(Result.d[4]);
                        $(tab + ' .city').html(Result.d[5]);
                        $(tab + ' .pincode').html(Result.d[6]);
                        $(tab + ' .planName').html(Result.d[7]);
                        alert();

                        alert($(li).text());


                    },
                    error: function (Result) {
                        alert("Error");
                    }
                });
            }
            else {
                //alert('jay jalaram');
                $('.active').removeClass("active");
                $(li).addClass("active");
                $(panel).addClass("active");
            }




        }
        function closeme(d) {

            var portlate = '#portlet_tab' + d;
            var li = '.liMerchantInfo' + d;
            $(portlate).remove();
            $(li).remove();
        }
    </script>
    <script>
        jQuery(document).ready(function () {
            TableAdvanced.init();
        });
    </script>
</asp:Content>
